﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NDiskTypeForm.aspx.cs"
    Inherits="AnyOffice.Web.general.system.netdisk.NDiskTypeForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Src="../../../Control/CheckRight.ascx" TagName="CheckRight" TagPrefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>公共文档柜设置</title>
    <script type="text/javascript">
        function CheckForm() {
            if (form1.txt_NDiskName.value == "") {
                alert("目录名称不能为空！");
                form1.txt_NDiskName.focus();
                return false;
            }
            if (form1.txt_NDiskPath.value == "") {
                alert("目录路径不能为空！");
                form1.txt_NDiskPath.focus();
                return false;
            }
            var reg = /[a-zA-Z]:(\\.+)*/;
            if (!reg.test(form1.txt_NDiskPath.value)) {
                alert("目录路径格式不正确!");
                return false
            }
            var pattern = /^[a-z\d\u4E00-\u9FA5\.]+$/i;
            if (!pattern.test(form1.txt_NDiskName.value)) {
                alert("名称不能包含特殊字符,请重新输入!");
                return false;
            }
            //var txt = new RegExp("[ ,\\`,\\~,\\!,\\@,\#,\\$,\\%,\\^,\\+,\\*,\\&,\\\\,\\/,\\?,\\|,\\:,\\.,\\<,\\>,\\{,\\},\\(,\\),\\'',\\;,\\=,\"]");
            var txt = new RegExp("[\\*,\\\\,\\/,\\?,\\|,\\:,\\<,\\>,\"]");
            //特殊字符正则表达式
            var path = form1.txt_NDiskPath.value;
            if (txt.test(form1.txt_NDiskPath.value.substring(path.lastIndexOf("\\") + 1, path.length - 1))) {
                alert("文件夹不能包含下列任何字符之一:\n  * \\ / ? | : < > \" ");
                return false
            }
            return true;
        }
       
    </script>
</head>
<body class="bodycolor" style="padding-top:0;">
    <form id="form1" runat="server">
     <div class="main_div">
    <table class="tab_pub" cellspacing="0" cellpadding="0" width="500" align="center" border="0">
        <tr>
            <td class="ta_bg">
                目录名称：<font color="red">*</font>
            </td>
            <td class="ta_txt">
                <asp:TextBox ID="txt_NDiskName" runat="server" CssClass="BigInput" MaxLength="100"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="ta_bg">
                目录路径(如 d:\soft)：<font color="red">*</font>
            </td>
            <td class="ta_txt">
                <asp:TextBox ID="txt_NDiskPath" runat="server" CssClass="BigInput" MaxLength="800"></asp:TextBox>
            </td>
        </tr>
        <tr align="center">
            <td colspan="2" class="bnt_con">
                <asp:Button ID="btnSave" runat="server" CssClass="BigButton" Text="确 定" OnClientClick="return CheckForm();"
                    OnClick="btnSave_Click" />
                <input class="BigButton" onclick="window.parent.menu_main.location='NDiskType.aspx'"
                    type="button" value="返 回" />
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="hdd_diskid" runat="server" />
    </div>
     <uc1:CheckRight ID="CheckRight1" runat="server" />
    </form>
   
</body>
</html>
